package com.scau402.system.service.impl;

import java.util.List;

import com.scau402.common.annotation.DataScope;
import com.scau402.common.utils.DateUtils;
import com.scau402.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.scau402.system.mapper.WmsStreamPlatformMapper;
import com.scau402.system.domain.WmsStreamPlatform;
import com.scau402.system.service.IWmsStreamPlatformService;

/**
 * 直播平台Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class WmsStreamPlatformServiceImpl implements IWmsStreamPlatformService 
{
    @Autowired
    private WmsStreamPlatformMapper wmsStreamPlatformMapper;

    /**
     * 查询直播平台
     * 
     * @param id 直播平台主键
     * @return 直播平台
     */
    @Override
    public WmsStreamPlatform selectWmsStreamPlatformById(Long id)
    {
        return wmsStreamPlatformMapper.selectWmsStreamPlatformById(id);
    }

    /**
     * 查询直播平台列表
     * 
     * @param wmsStreamPlatform 直播平台
     * @return 直播平台
     */
    @Override
    @DataScope(tenantAlias = "t", userAlias = "u")
    public List<WmsStreamPlatform> selectWmsStreamPlatformList(WmsStreamPlatform wmsStreamPlatform)
    {
        wmsStreamPlatform.setTenantId(SecurityUtils.getLoginUser().getTenantId());
        return wmsStreamPlatformMapper.selectWmsStreamPlatformList(wmsStreamPlatform);
    }

    /**
     * 新增直播平台
     * 
     * @param wmsStreamPlatform 直播平台
     * @return 结果
     */
    @Override
    public int insertWmsStreamPlatform(WmsStreamPlatform wmsStreamPlatform)
    {
        wmsStreamPlatform.setCreateTime(DateUtils.getNowDate());
        wmsStreamPlatform.setTenantId(SecurityUtils.getLoginUser().getTenantId());
        return wmsStreamPlatformMapper.insertWmsStreamPlatform(wmsStreamPlatform);
    }

    /**
     * 修改直播平台
     * 
     * @param wmsStreamPlatform 直播平台
     * @return 结果
     */
    @Override
    public int updateWmsStreamPlatform(WmsStreamPlatform wmsStreamPlatform)
    {
        wmsStreamPlatform.setUpdateTime(DateUtils.getNowDate());
        wmsStreamPlatform.setTenantId(SecurityUtils.getLoginUser().getTenantId());
        return wmsStreamPlatformMapper.updateWmsStreamPlatform(wmsStreamPlatform);
    }

    /**
     * 批量删除直播平台
     * 
     * @param ids 需要删除的直播平台主键
     * @return 结果
     */
    @Override
    public int deleteWmsStreamPlatformByIds(Long[] ids)
    {
        return wmsStreamPlatformMapper.deleteWmsStreamPlatformByIds(ids);
    }

    /**
     * 删除直播平台信息
     * 
     * @param id 直播平台主键
     * @return 结果
     */
    @Override
    public int deleteWmsStreamPlatformById(Long id)
    {
        return wmsStreamPlatformMapper.deleteWmsStreamPlatformById(id);
    }
}
